SUBROUTINE EDITORIAL
     * Demonstrate the use of the "editorial" subroutines,
     * RWS_ED_INSERT and RWS_ED_DELETE.

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page.
     CALL RW_START_HTML_PAGE("Editorial Example", "", "", "", "")

     HTML = ""

     * Insert a level 1 heading.
     TEXT = "Overview"
     CALL RWS_HEADING(TEXT, 1, 'style="color: purple"')
     HTML = HTML : TEXT

     * Define some text.
     TEXT = "Reality is a software environment that supports Reality " : ...
        "applications on UNIX and Windows (NT, 2000 and XP) systems. The " : ...
        "applications support environment supplied by Reality is a Relational " : ...
        "Database Management System (RDBMS), supporting multiple databases on " : ...
        "a single host platform, a range of powerful programs for database " : ...
        "management and inquiry, and a set of programs for operating system " : ...
        "resources."

     * We will replace all occurrences of the word "programs" with "utilities",
     * and mark the change as editorial.
     OLD = "programs"
     NEW = "utilities"
     * Set up the date of the change.
     aClass = ""
     aClass<3> = OCONV(DATE(), "DS") : "T" : OCONV(TIME(), "MTS") : "Z"
     * Mark the old text as a deletion ...
     ED_OLD = OLD
     CALL RWS_ED_DELETE(ED_OLD, "", aClass)
     * ... and the new text as an insertion.
     CALL RWS_ED_INSERT(NEW, "", aClass)

     * Make the change.
     TEXT = CHANGE(TEXT, OLD, ED_OLD : NEW)

     * Format the text as a paragraph and add to the HTML.
     CALL RWS_PARA(TEXT, "", "")
     HTML = HTML : TEXT

     * Insert a level 2 heading.
     TEXT = "Multiple Databases"
     CALL RWS_HEADING(TEXT, 2, "")
     HTML = HTML : TEXT

     * Define some more text.
     TEXT = "Any number of databases can be created and maintained on the host. " : ...
        "The only restriction is disk space availability. This allows " : ...
        "independent use of different databases by different departments or " : ...
        "groups using the system. Each separate database comprises a collection " : ...
        "of data organised in relational data structures enabling easy access " : ...
        "to, and manipulation of data."

     * We will add the text "and secure" after the word "independent", and
     * mark the change as an insertion.
     OLD = "independent "
     NEW = "and secure "
     * Set up the date of the change.
     aClass = ""
     aClass<3> = OCONV(DATE(), "DS") : "T" : OCONV(TIME(), "MTS") : "Z"
     * Mark the new text as an insertion.
     CALL RWS_ED_INSERT(NEW, "", aClass)

     * Make the change.
     TEXT = CHANGE(TEXT, OLD, OLD : NEW)

     * We will delete the text "separate" and mark the change as a deletion.
     OLD = "separate "
     ED_OLD = OLD
     * Set up the date of the change.
     aClass = ""
     aClass<3> = OCONV(DATE(), "DS") : "T" : OCONV(TIME(), "MTS") : "Z"
     * Mark the new text as a deletion.
     CALL RWS_ED_DELETE(ED_OLD, "", aClass)

     * Make the change.
     TEXT = CHANGE(TEXT, OLD, ED_OLD)

     * Format the text as a paragraph and add to the HTML.
     CALL RWS_PARA(TEXT, "", "")
     HTML = HTML : TEXT

     * Output the HTML.
     CALL RW_PUT(HTML)

     * Complete the page.
     CALL RW_END_PAGE
RETURN

Go to top button